package Week10;

import java.io.Serializable;



public class Point implements Geometry, Serializable {
	//A Point is defined with a pair of (x, y) coordinates.

	// Declare member variables
	private double x,y;

	// 1st constructor for point using x, y coordinates
	public Point(double xcoord, double ycoord){
		x = xcoord;
		y = ycoord;
	}

	// 2nd constructor for point using x, y coordinates
	public Point(int xcoord, int ycoord){
		x = xcoord;
		y = ycoord;
	}
	
	// 3rd constructor for point using 0, 0 coordinates
	public Point(){
		x = 0;
		y = 0;
	}

	public double computeArea() {
		return 0;
	}

	public double computeLength() {
		return 0;
	}

	public int computeDimension() {
		return 1;
	}

	// Override for printing point
	public String toString() {
		return "(" + x + ", " + y + ")";
	}
	
	// Getters and setters
	public double getX() {
		return x;
	}

	public void setX(double x) {
		this.x = x;
	}

	public double getY() {
		return y;
	}

	public void setY(double y) {
		this.y = y;
	}
	
	public double getDistance(Point userPoint){
		double dist;
		dist = Math.sqrt(((Math.pow((userPoint.x-x), 2)+Math.pow((userPoint.y-y), 2))));
		return dist;
	}
	


}
